package com.nulijiushimeili.casclient.entity;

import java.util.Collection;
import java.util.HashSet;
import java.util.Set;

import com.nulijiushimeili.casclient.Service.AuthorityInfo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;


@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class UserInfo implements UserDetails {
  private static final long serialVersionUID = -1041327031937199938L;

  /**
   * 用户ID
   */
  private Long id;

  /**
   * 用户名称
   */
  private String name;

  /**
   * 登录名称
   */
  private String username;

  /**
   * 登录密码
   */
  private String password;

  private boolean isAccountNonExpired = true;

  private boolean isAccountNonLocked = true;

  private boolean isCredentialsNonExpired = true;

  private boolean isEnabled = true;

  private Set<AuthorityInfo> authorities = new HashSet<AuthorityInfo>();

}

